Why am I getting an incompatible type error when using the List Iterator's next method but not when